const mongoose = require('mongoose')

const Goods = mongoose.model('Goods', new mongoose.Schema({
    name: {type: String}, //名称
    desc: {type: String}, //描述
    originalPrice: {type: Number}, //原价
    presentPrice: {type: Number}, //现价
    stock: {type: Number}, //库存
    specifications: {type: String}, //规格
    pic: {type: Array}, //图片
    category: {type: mongoose.SchemaTypes.ObjectId, ref: 'Category'}, //类别
    detail: {type: String},//详情
    state: {type: String} //上架或者下架的状态 1:上架 0:下架
},{timestamps: true}))

module.exports = Goods